package com.weixin.paleituo.fragment;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.weixin.paleituo.R;
import com.weixin.paleituo.activity.AfterSaleActivity;
import com.weixin.paleituo.activity.BuyHouseListActivity;
import com.weixin.paleituo.activity.CompanyAptitudeActivity;
import com.weixin.paleituo.activity.CouponsActivity;
import com.weixin.paleituo.activity.GetUpBuyHouseActivity;
import com.weixin.paleituo.activity.LoginActivity;
import com.weixin.paleituo.activity.ManagerAddressActivity;
import com.weixin.paleituo.activity.MyAppoinMentListActivity;
import com.weixin.paleituo.activity.MyBrokerageActivity;
import com.weixin.paleituo.activity.MyMessageActivity;
import com.weixin.paleituo.activity.MyOrderActivity;
import com.weixin.paleituo.activity.PersonInfoActivity;
import com.weixin.paleituo.activity.SetActivity;
import com.weixin.paleituo.activity.ShopCarActivity;
import com.weixin.paleituo.activity.TemplateDetailsActivity;
import com.weixin.paleituo.activity.VisterRecordActivity;
import com.weixin.paleituo.application.BaseApplication;
import com.weixin.paleituo.base.BaseFragment;
import com.weixin.paleituo.bean.MyBrokerageBean;
import com.weixin.paleituo.bean.MyVisitorBean;
import com.weixin.paleituo.bean.StatusCode;
import com.weixin.paleituo.bean.UserInfoBean;
import com.weixin.paleituo.eventbus.DeleteAppoinmentSuccessEvent;
import com.weixin.paleituo.eventbus.ExitLoginSuccess;
import com.weixin.paleituo.eventbus.LoginMessageEvent;
import com.weixin.paleituo.eventbus.UpdataBrokerageEvent;
import com.weixin.paleituo.eventbus.UpdataInfoEvent;
import com.weixin.paleituo.http.HttpUtil;
import com.weixin.paleituo.http.ProgressSubscriber;
import com.weixin.paleituo.rxjava.ApiUtils;
import com.weixin.paleituo.util.BlurUtil;
import com.weixin.paleituo.util.LogUtils;
import com.weixin.paleituo.util.StringUtils;
import com.weixin.paleituo.util.UIUtils;
import com.weixin.paleituo.view.CircleTransform;
import com.weixin.paleituo.view.ItemNewMyView;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.BindView;
import butterknife.OnClick;
import butterknife.Unbinder;
import io.reactivex.Observable;

/**
 * Author yichao
 * Time  2017/11/30 9:10
 * Dest  我的
 */

public class MyFragment extends BaseFragment {

    @BindView(R.id.iv_headico_fragment_my)
    ImageView mIvHeadicoFragmentMy;
    @BindView(R.id.itenmyview_contract_number_fragment_my)
    ItemNewMyView mItenmyviewContractNumberFragmentMy;

    @BindView(R.id.itenmyview_set_fragment_my)
    ItemNewMyView mItenmyviewSetFragmentMy;
    @BindView(R.id.rl_toproot_fragment_my)
    RelativeLayout mRlTopRootView;
    @BindView(R.id.tv_nike_fragment)
    TextView mTvNikeFragment;
    @BindView(R.id.ll_login_after_fragment_my)
    LinearLayout mLlLoginAfterFragmentMy;
    @BindView(R.id.tv_gologin_fragment_my)
    TextView mTvGologinFragmentMy;
    @BindView(R.id.ll_login_before_fragment)
    LinearLayout mLlLoginBeforeFragment;
    @BindView(R.id.ll_coupons_fragment_my)
    LinearLayout mLlCouponsFragment;
    @BindView(R.id.itenmyview_visiterrecord_fragment_my)
    ItemNewMyView mItenmyviewVisterRecordFragmentMy;
    @BindView(R.id.ll_buylist_fragmetn_my)
    LinearLayout mLlBuylistFragmetnMy;
    @BindView(R.id.ll_message_fragment_my)
    LinearLayout mLlMessageFragmentMy;
    @BindView(R.id.ll_myorder_my_fragment)
    LinearLayout mLlMyorderMyFragment;
    @BindView(R.id.itenmyview_getupbuyhouse_fragment_my)
    ItemNewMyView mItenmyviewGetupbuyhouseFragmentMy;
    Unbinder unbinder;
    @BindView(R.id.ll_awaitfor_fragment_my)
    LinearLayout mLlAwaitforFragmentMy;
    @BindView(R.id.ll_awaitreceive_fragment_my)
    LinearLayout mLlAwaitreceiveFragmentMy;
    @BindView(R.id.ll_completeorder_fragment_my)
    LinearLayout mLlCompleteorderFragmentMy;
    @BindView(R.id.ll_cancelorder_fragment_my)
    LinearLayout mLlCancelorderFragmentMy;
    @BindView(R.id.ll_shopcar_fragment_my)
    LinearLayout mLlShopcarFragmentMy;
    @BindView(R.id.item_manager_address_fragment_my)
    ItemNewMyView mItemManagerAddressFragmentMy;
    @BindView(R.id.item_add_invoice_manager_fragment_my)
    ItemNewMyView mItemAddInvoiceManagerFragmentMy;
    @BindView(R.id.itenmyview_attention_fragment_my)
    ItemNewMyView mItenmyviewAttentionFragmentMy;
    @BindView(R.id.iv_pre_arrow_fragment_my)
    ImageView mIvPreArrowFragmentMy;
    @BindView(R.id.rl_pre_headroot_fragment_my)
    RelativeLayout mRlPreHeadrootFragmentMy;
    @BindView(R.id.ll_pre_content_root_fragment_my)
    LinearLayout mLlPreContentRootFragmentMy;
    @BindView(R.id.iv_icon_yongjin_fragment_my)
    ImageView mIvIconYongjinFragmentMy;
    @BindView(R.id.iv_yongjin_arrow_fragment_my)
    ImageView mIvYongjinArrowFragmentMy;
    @BindView(R.id.ll_yongjin_sum_fragment_my)
    LinearLayout mLlYongjinSumFragmentMy;
    @BindView(R.id.ll_yongjing_provide_fragment_my)
    LinearLayout mLlYongjingProvideFragmentMy;
    @BindView(R.id.ll_yongjing_alread_extract_fragment_my)
    LinearLayout mLlYongjingAlreadExtractFragmentMy;
    @BindView(R.id.ll_yongjing_contentroot_framgnet_my)
    LinearLayout mLlYongjingContentrootFramgnetMy;
    @BindView(R.id.ll_alreadpre_frament_my)
    LinearLayout mLlAlreadpreFramentMy;
    @BindView(R.id.ll_alreadpre_visted_fragment_my)
    LinearLayout mLlAlreadpreVistedFragmentMy;
    @BindView(R.id.ll_pre_cancel_fragment_my)
    LinearLayout mLlPreCancelFragmentMy;
    @BindView(R.id.tv_pre_alreadpre_fragment_my)
    TextView mtvAlreadPre;
    @BindView(R.id.tv_alreadpre_visted_fragment_my)
    TextView mtvAlreadpreVisted;
    @BindView(R.id.tv_pre_cancel_fragment_my)
    TextView mTvPreCancel;
    @BindView(R.id.tv_yongjin_total_fragment_my)
    TextView mTvBrokerageTotal;
    @BindView(R.id.tv_yongjin_withdrawing_fragment_my)
    TextView mTvBrokerageWithdrawing;
    @BindView(R.id.tv_yongjin_withdrawal_fragment_my)
    TextView mTvBrokerageWithdrawal;


    private View mContentView;

    /**
     * 登录成功
     *
     * @param loginMessageEvent
     */
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(LoginMessageEvent loginMessageEvent) {
        mLlLoginBeforeFragment.setVisibility(View.INVISIBLE);
        mLlLoginAfterFragmentMy.setVisibility(View.VISIBLE);
        if (!StringUtils.isEmpty(BaseApplication.sUserInfoBean.nickname)) {
            mTvNikeFragment.setText(BaseApplication.sUserInfoBean.nickname);
        }
        if (!StringUtils.isEmpty(loginMessageEvent.getInfoBean().imgurl)) {
            Glide.with(this)
                    .load(loginMessageEvent.getInfoBean().imgurl)
                    .placeholder(R.mipmap.mrtx)
                    .transform(new CircleTransform(mContext))
                    .into(mIvHeadicoFragmentMy);
        }

        //登录成功

        UserInfoBean infoBean = loginMessageEvent.getInfoBean();

        MyVisitorBean myVisitor = infoBean.getMyVisitor();

        if (myVisitor != null) {
            mtvAlreadPre.setText(myVisitor.getAppiontNum() + "");
            mtvAlreadpreVisted.setText(myVisitor.getVisitNum() + "");
            mTvPreCancel.setText(myVisitor.getCancelNum() + "");
        }

        MyBrokerageBean brief = infoBean.getBrief();
        if (brief != null) {
            mTvBrokerageTotal.setText(String.valueOf(brief.getBalance()));
            mTvBrokerageWithdrawing.setText(String.valueOf(brief.getPutForward()));
            mTvBrokerageWithdrawal.setText(String.valueOf(brief.getTotalAmount()));
        }

    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void exitLoginSuccess(ExitLoginSuccess exitLoginSuccess) {
        mLlLoginBeforeFragment.setVisibility(View.VISIBLE);
        mLlLoginAfterFragmentMy.setVisibility(View.INVISIBLE);
        mIvHeadicoFragmentMy.setImageResource(R.mipmap.mrtx);

        mtvAlreadPre.setText("0");
        mtvAlreadpreVisted.setText("0");
        mTvPreCancel.setText("0");

        mTvBrokerageTotal.setText("0.00");
        mTvBrokerageWithdrawing.setText("0.00");
        mTvBrokerageWithdrawal.setText("0.00");
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void updataPersonInfo(UpdataInfoEvent updataInfoEvent) {
        String imgurl = updataInfoEvent.getImgurl();
        if (!StringUtils.isEmpty(imgurl)) {
            Glide.with(this)
                    .load(imgurl)
                    .placeholder(R.mipmap.mrtx)
                    .transform(new CircleTransform(mContext))
                    .into(mIvHeadicoFragmentMy);
        }

    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void updataBrokerage(UpdataBrokerageEvent event) {
        refreshBrokerage();
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void deleteAppoinmentSuccessEvent(DeleteAppoinmentSuccessEvent event) {

        int state = event.getState();
            MyVisitorBean myVisitor = BaseApplication.sUserInfoBean.getMyVisitor();

        if (state==2){

            myVisitor.setSubVisitNum();


        }else if (state==3){
            myVisitor.setSubCancelNum();

        }
        if (myVisitor != null) {
            mtvAlreadPre.setText(myVisitor.getAppiontNum() + "");
            mtvAlreadpreVisted.setText(myVisitor.getVisitNum() + "");
            mTvPreCancel.setText(myVisitor.getCancelNum() + "");
        }

    }



    @Override
    protected void initData() {
        super.initData();
        // LogUtils.i(TAG,BaseApplication.sUserInfoBean.toString());

        if (!EventBus.getDefault().isRegistered(this)) {

            EventBus.getDefault().register(this);
        }

        showBlurBackground();
        if (BaseApplication.isLoginSuccess) {
            mLlLoginAfterFragmentMy.setVisibility(View.VISIBLE);
            if (!StringUtils.isEmpty(BaseApplication.sUserInfoBean.nickname)) {
                mTvNikeFragment.setText(BaseApplication.sUserInfoBean.nickname);
            }

            String imgurl = BaseApplication.sUserInfoBean.imgurl;


            LogUtils.i(TAG, "图片地址    JJJJJ" + imgurl);
            if (!StringUtils.isEmpty(imgurl)) {
                Glide.with(mContext)
                        .load(imgurl)
                        .placeholder(R.mipmap.mrtx)
                        .transform(new CircleTransform(mContext))
                        .into(mIvHeadicoFragmentMy);
            }

            UserInfoBean infoBean = BaseApplication.sUserInfoBean;

            MyVisitorBean myVisitor = infoBean.getMyVisitor();

            if (myVisitor != null) {
                mtvAlreadPre.setText(myVisitor.getAppiontNum() + "");
                mtvAlreadpreVisted.setText(myVisitor.getVisitNum() + "");
                mTvPreCancel.setText(myVisitor.getCancelNum() + "");
            }

            MyBrokerageBean brief = infoBean.getBrief();
            if (brief != null) {
                mTvBrokerageTotal.setText(UIUtils.getMoney(brief.getBalance()));
                mTvBrokerageWithdrawing.setText(UIUtils.getMoney(brief.getPutForward()));
                mTvBrokerageWithdrawal.setText(UIUtils.getMoney(brief.getTotalAmount()));
            }

        } else {
            mLlLoginBeforeFragment.setVisibility(View.VISIBLE);
        }

        LogUtils.i(TAG, "我的登录初始化界面 initdata");
    }

    private void showBlurBackground() {

        Bitmap bitmap1 = BitmapFactory.decodeResource(getResources(), R.mipmap.my_bg);
        Bitmap bitmap = BlurUtil.doBlur(bitmap1, 8, false);
        bitmap1.recycle();
        mRlTopRootView.setBackground(new BitmapDrawable(getResources(), bitmap));

    }

    @Override
    public View initView(Context context) {
        mContentView = UIUtils.inflate(context, R.layout.fragment_my);

        return mContentView;
    }

    /**
     * 单独刷新佣金数据
     */
    private void refreshBrokerage() {

        if (BaseApplication.isLoginSuccess){
            Observable<StatusCode<MyBrokerageBean>> observable = ApiUtils.getApi().refreshBrokerage(
                    BaseApplication.getToken(), BaseApplication.getUserId(), BaseApplication.sUserInfoBean.getUsername());
            HttpUtil.getInstance().toSubscribe(observable, new ProgressSubscriber<MyBrokerageBean>(getContext()) {
                @Override
                protected void _onNext(StatusCode<MyBrokerageBean> statusCode) {
                    MyBrokerageBean brief = statusCode.getData();
                    if (brief != null) {
                        mTvBrokerageTotal.setText(UIUtils.getMoney(brief.getBalance()));
                        mTvBrokerageWithdrawing.setText(UIUtils.getMoney(brief.getPutForward()));
                        mTvBrokerageWithdrawal.setText(UIUtils.getMoney(brief.getTotalAmount()));

                        BaseApplication.sUserInfoBean.setBrief(brief);
                    }
                }

                @Override
                protected void _onError(String message) {
                }
            }, "", lifecycleSubject, false, true);

        }



    }

    @OnClick(R.id.iv_headico_fragment_my)
    public void onMIvHeadicoFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {

            PersonInfoActivity.startActivity(mContext);
        } else {
            LoginActivity.startActivity(mContext, true);
        }


    }

    @OnClick(R.id.item_add_invoice_manager_fragment_my)
    public void onAddInvoiceManager() {


        if (BaseApplication.isLoginSuccess) {
            startActivity(CompanyAptitudeActivity.call2CompanyAptitudeActivity(getContext()));
        } else {
            LoginActivity.startActivity(mContext, true);

        }
    }

    @OnClick(R.id.ll_tuihuo_fragment_my)
    public void onllTuiHuo() {


        if (BaseApplication.isLoginSuccess) {
            AfterSaleActivity.myStartActivity(mContext);
        } else {
            LoginActivity.startActivity(mContext, true);

        }
    }



/*    @OnClick(R.id.itenmyview_mymessage)
    public void onMItenmyviewMymessageClicked() {



    }*/




    /**
     * 优惠券
     */
    @OnClick(R.id.ll_coupons_fragment_my)
    public void onllCouponsFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {
            CouponsActivity.startActivity(mContext);

        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }

    @OnClick(R.id.ll_login_after_fragment_my)
    public void onllLoginAfterFragmentMyClicked() {

        PersonInfoActivity.startActivity(mContext);
    }

    @OnClick(R.id.itenmyview_contract_number_fragment_my)
    public void onMItenmyviewContractNumberFragmentMyClicked() {

        //  AppointmentsLookHouseActivity.startActivity(mContext, 0l);
        String details = mItenmyviewContractNumberFragmentMy.getDetails();
        if (!StringUtils.isEmpty(details)) {
            try {
                Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + details));
                mContext.startActivity(dialIntent);
            } catch (Exception e) {

            }


        }


    }

    @OnClick(R.id.itenmyview_visiterrecord_fragment_my)
    public void onItemVisterRecordClicked(View view) {
        if (!BaseApplication.isLoginSuccess) {
            LoginActivity.startActivity(mContext, true);
        } else {

            VisterRecordActivity.startActivity(mContext);
        }
    }

    @OnClick(R.id.itenmyview_set_fragment_my)
    public void onMItenmyviewSetFragmentMyClicked() {
        //设置
        SetActivity.startActivity(mContext);

    }

    @OnClick(R.id.tv_gologin_fragment_my)
    public void onGoLoginViewClicked() {
        LoginActivity.startActivity(mContext, true);
    }


    @OnClick(R.id.ll_buylist_fragmetn_my)
    public void onMLlBuylistFragmetnMyClicked() {

        if (BaseApplication.isLoginSuccess) {
            BuyHouseListActivity.startActivity(mContext);

        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }

    @OnClick(R.id.ll_message_fragment_my)
    public void onMLlMessageFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {

            MyMessageActivity.startActivity(mContext, BaseApplication.sUserInfoBean.userId);
        } else {

            LoginActivity.startActivity(mContext, true);
        }

    }

    @OnClick(R.id.itenmyview_getupbuyhouse_fragment_my)
    public void getupBuyHouse() {
        if (BaseApplication.isLoginSuccess) {

            GetUpBuyHouseActivity.startActivity(mContext);
        } else {

            LoginActivity.startActivity(mContext, true);
        }
    }

    /**
     * 跳转地址管理界面
     *
     * @author fengzhen
     * @version v1.0, 2018/3/28
     */
    @OnClick(R.id.item_manager_address_fragment_my)
    void gotoAddressManager() {
        if (BaseApplication.isLoginSuccess) {
            startActivity(ManagerAddressActivity.call2AddressManagerActivity(getContext(), ManagerAddressActivity.TYPE_FROM_USER, -1));
        } else {
            LoginActivity.startActivity(mContext, true);
        }

    }

    /**
     * 跳转我的关注
     */
    @OnClick(R.id.itenmyview_attention_fragment_my)
    void gotoMyAttention() {
        if (BaseApplication.isLoginSuccess) {
            startActivity(TemplateDetailsActivity.call2TempalteDetails(getContext(), 3));
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }


    @OnClick(R.id.ll_myorder_my_fragment)
    public void onViewMyOrderClicked() {
        if (BaseApplication.isLoginSuccess) {
            MyOrderActivity.startActivity(mContext, BaseApplication.getUserId(), 0);
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }


    @OnClick(R.id.ll_awaitfor_fragment_my)
    public void onMLlAwaitforFragmentMyClicked() {

        if (BaseApplication.isLoginSuccess) {
            MyOrderActivity.startActivity(mContext, BaseApplication.getUserId(), 1);
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }

    @OnClick(R.id.ll_awaitreceive_fragment_my)
    public void onMLlAwaitreceiveFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {
            MyOrderActivity.startActivity(mContext, BaseApplication.getUserId(), 2);
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }

    @OnClick(R.id.ll_completeorder_fragment_my)
    public void onMLlCompleteorderFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {
            MyOrderActivity.startActivity(mContext, BaseApplication.getUserId(), 3);
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }

    @OnClick(R.id.ll_cancelorder_fragment_my)
    public void onMLlCancelorderFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {
            MyOrderActivity.startActivity(mContext, BaseApplication.getUserId(), 4);
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }

    @OnClick(R.id.ll_shopcar_fragment_my)
    public void onMLlShopcarFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess) {

            ShopCarActivity.startActivity(mContext);
        } else {
            LoginActivity.startActivity(mContext, true);
        }
    }


    @OnClick(R.id.rl_pre_headroot_fragment_my)
    public void onMRlPreHeadrootFragmentMyClicked() {


        int visibility = mLlPreContentRootFragmentMy.getVisibility();

        if (visibility == View.GONE) {
            mIvPreArrowFragmentMy.setImageResource(R.mipmap.arrow_top);
            mLlPreContentRootFragmentMy.setVisibility(View.VISIBLE);
            //不可见

        } else if (visibility == View.VISIBLE) {
            //可见arrow_my.png
            mLlPreContentRootFragmentMy.setVisibility(View.GONE);
            mIvPreArrowFragmentMy.setImageResource(R.mipmap.arrow_my);

        }


    }


    /**
     * 总的佣金
     */
    @OnClick(R.id.ll_yongjin_sum_fragment_my)
    public void onMLlYongjinSumFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess){

        Intent intent = MyBrokerageActivity.call2MyBrokerageActivity(getContext(), 0);
        startActivity(intent);
        }else {
            LoginActivity.startActivity(mContext,true);
        }

    }

    /**
     * 佣金发放中
     */
    @OnClick(R.id.ll_yongjing_provide_fragment_my)
    public void onMLlYongjingProvideFragmentMyClicked() {

        if (BaseApplication.isLoginSuccess){

        Intent intent = MyBrokerageActivity.call2MyBrokerageActivity(getContext(), 1);
        startActivity(intent);
        }else {
            LoginActivity.startActivity(mContext,true);
        }
    }

    /**
     * 佣金已经提用
     */
    @OnClick(R.id.ll_yongjing_alread_extract_fragment_my)
    public void onMLlYongjingAlreadExtractFragmentMyClicked() {

        if (BaseApplication.isLoginSuccess){
            Intent intent = MyBrokerageActivity.call2MyBrokerageActivity(getContext(), 2);
            startActivity(intent);
        }else {
            LoginActivity.startActivity(mContext,true);
        }

    }

    /**
     * 点击佣金
     */
    @OnClick(R.id.rl_yongjing_headroot_fragment_my)
    public void onMLlYongjingheadrootFramgnetMyClicked() {

        int visibility = mLlYongjingContentrootFramgnetMy.getVisibility();

        if (visibility == View.GONE) {
            //隐藏
            mIvYongjinArrowFragmentMy.setImageResource(R.mipmap.arrow_top);
            mLlYongjingContentrootFramgnetMy.setVisibility(View.VISIBLE);
        } else if (visibility == View.VISIBLE) {
            //显示
            mIvYongjinArrowFragmentMy.setImageResource(R.mipmap.arrow_my);
            mLlYongjingContentrootFramgnetMy.setVisibility(View.GONE);
            refreshBrokerage();
        }

    }

    /**
     * 已经预约
     */
    @OnClick(R.id.ll_alreadpre_frament_my)
    public void onMLlAlreadpreFramentMyClicked() {

if (BaseApplication.isLoginSuccess){

        MyAppoinMentListActivity.myStartActivity(mContext,0);
}else {
    LoginActivity.startActivity(mContext,true);
}



    }

    /**
     * 预约以及参观
     */
    @OnClick(R.id.ll_alreadpre_visted_fragment_my)
    public void onMLlAlreadpreVistedFragmentMyClicked() {
        if (BaseApplication.isLoginSuccess){

            MyAppoinMentListActivity.myStartActivity(mContext,1);
        }else {
            LoginActivity.startActivity(mContext,true);
        }

    }

    /**
     * 预约已经取消
     */
    @OnClick(R.id.ll_pre_cancel_fragment_my)
    public void onMLlPreCancelFragmentMyClicked() {

        if (BaseApplication.isLoginSuccess){

            MyAppoinMentListActivity.myStartActivity(mContext,2);
        }else {
            LoginActivity.startActivity(mContext,true);
        }
    }




}
